<template>
	<view>
		<uni-nav-bar dark :fixed="true" shadow background-color="#00aaff" status-bar left-icon="left" title="开户类型" @clickLeft="back"/>
		<view class="page">
			<view class="header">
				<uni-title type="h1" align="center" title="请选择电子账簿类型"></uni-title>
			</view>
			<view class="btn-box" data-url="/pages/openAccount/personal" @tap="toDrup">
				<image class="image" src="@/static/images/personal.png"></image>
				<view> 个人开户 </view>
			</view>
			<view class="btn-box" data-url="/pages/openAccount/business" @tap="toDrup">
				<image class="image" src="@/static/images/business.png"></image>
				<view> 企业开户 </view>
			</view>
		</view>
	</view>
</template>

<script>
	
	
	export default {
		data() {
			return {
			}
		},
		onShow() {
			let uid = uni.getStorageSync('uid');
			
			if(!uid || uid == "") {
				uni.navigateTo({
					url: '/pages/login/index'
				})
			}
		},
		methods: {
			back() {
				uni.redirectTo({
					url: '/pages/index/index'
				})
			},
			toDrup( e ) {
				let url = e.currentTarget.dataset.url
				
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		width: 750rpx;
		padding-bottom: env(safe-area-inset-bottom);
	}
	
	.header {
		margin-top: 40rpx;
	}
	
	.btn-box {
		width: 280rpx;
		height: 300rpx;
		background: #fff;
		margin: 80rpx auto;
		padding: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		align-items: center;
		border-radius: 10rpx;
		font-weight: bold;
		color: #00BCD4;
		box-shadow: $uni-shadow-base;
		
		.image {
			height: 120rpx;
			width: 120rpx;
		}
	}
</style>